package jxgcxy.com;

public class Pet {
    String name;
    String color;
    int age;
    double price;

    public Pet() {
    }

    public Pet(String name, String color, int age, double price) {
        this.name = name;
        this.color = color;
        this.age = age;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void move(){
        System.out.println("我是可以移动的");
    }
    public void enjoy(){
        System.out.println("我很高兴");
    }

    public static class Bird extends Pet{
        private int number;

        public Bird(String name, String color, int age, double price, int number) {
            super(name, color, age, price);
            this.number = number;
        }

        @Override
        public void move() {
            System.out.println("我是可以飞的");
        }

        @Override
        public void enjoy() {
            System.out.println("我很高兴，啾啾啾");

        }
    }

    public static class Cat extends Pet {
        private String kind;

        public Cat(String name, String color, int age, double price, String kind) {
            super(name, color, age, price);
            this.kind = kind;
        }

        @Override
        public void move() {
            System.out.println("我是可以跑的");
        }

        @Override
        public void enjoy() {
            System.out.println("我很高兴，喵喵喵");
        }
    }
}
